<?php

namespace addons\websocketpush\controller;

use addons\websocketpush\Websocketpush;
use app\admin\library\Auth;
use think\addons\Controller;

class Index extends Controller
{
    public function _initialize()
    {
        if (!Auth::instance()->id) {
            $this->error('暂无浏览权限');
        }

        parent::_initialize();
    }

    public function index()
    {
        $this->error("当前插件暂无前台页面");
    }

    public function push()
    {
        return json(Websocketpush::pushToGroups('后台消息！', ['Admin group']));
    }
}
